<%-- 
    Document   : TTDatVe
    Created on : May 31, 2014, 10:44:19 AM
    Author     : Tu Nguyen
--%>

<%@page import="DTO.DatVeDTO"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="../../assets/ico/favicon.ico">
    <link href="view/Bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css"/>
    <title>Navbar Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    

    <!-- Custom styles for this template -->
    <link href="navbar.css" rel="stylesheet">
  </head>

  <body>

    <div class="container">
       
      <!-- Static navbar -->
      <%@include file="Menu.jsp" %>
      <img src="view/Images/train1.jpg" alt="" width="100%" height="350"/>
      <div class="jumbotron">
          <table class="table table-responsive">
            <tr class="info">
                <td>id</td>
                <td>Tên chuyến</td>
                <td>GaDen</td>
                <td>Ga Di</td>
                <td>CMND</td>
                <td>Ghe</td>
                <td>Gia ve</td>
                <td>Tùy chọn</td>
            </tr>
           <%  HttpSession ss = request.getSession(); 
             if(ss.getAttribute("TTDatVe")!= null)
             {
                 ArrayList<DatVeDTO> tmp = new ArrayList<DatVeDTO>();
                tmp = (ArrayList<DatVeDTO>) ss.getAttribute("TTDatVe");
               for(int i = 0; i <tmp.size(); i ++)
               {
                 %>
                 <form action="HuyDatGhe" method="POST">
                 <tr>
                     <td><%= tmp.get(i).id %></td>
                     <td><%= tmp.get(i).chuyen %></td>
                     <td><%= tmp.get(i).ga_den %></td>
                     <td><%= tmp.get(i).ga_di %></td>
                     <td><%= tmp.get(i).cmnd %></td>
                      <td><%= tmp.get(i).ghe %></td>
                      <td><%= tmp.get(i).giave %></td>
                 <input type="hidden" name="id" value="<%= tmp.get(i).id %>" />
                      <td><button type="submit" class="btn btn-danger">Xóa</button>
                 </tr>
                 </form>
           <%
               }
            } %>
            <tr>
                <td colspan="8"> <a href="SubmitDatVe" class="btn btn-success">Đặt mua</a></td>
            </tr>
        </table>
         
      </div>
      
    </div> <!-- /container -->


    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script src="view/Bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
  </body>
</html>
